package com.sayyi.demo.bean.copy.cglib;

import com.sayyi.demo.bean.ParentDemo;
import com.sayyi.demo.bean.domain.Dest;
import com.sayyi.demo.bean.domain.Source;
import net.sf.cglib.beans.BeanCopier;

/**
 * @author xuchuang
 * date 2021/12/20 2:39 PM
 */
public class CglibDemo {

    public static void main(String[] args) {
        final Source source = ParentDemo.genSource();
        final BeanCopier beanCopier = BeanCopier.create(Source.class, Dest.class, false);

        Dest dest = new Dest();
        beanCopier.copy(source, dest, null);
        System.out.println(dest);
    }
}
